package com.example.demos.mapper;

import com.example.demos.dto.MarketDetailDTO;
import com.example.demos.dto.MarketDetailUpdateDTO;
import com.example.demos.entity.StoreOper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.cglib.core.Local;

import java.math.BigInteger;
import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface MarketDetailMapper {

    int updateMarketDetailState(@Param("marketDetailId") BigInteger marketDetailId,
                                @Param("storeUuid") BigInteger storeUuid,
                                @Param("endTime") LocalDateTime endTime,
                                @Param("ender") String ender);

    Integer queryStoreNum(@Param("goodsId") BigInteger goodsId,
                          @Param("storeUuid") BigInteger storeUuid);


    int updateStoreDetailNum(@Param("goodsId") BigInteger goodsId,
                             @Param("storeUuid") BigInteger storeUuid,
                             @Param("goodsNum") BigInteger goodsNum);

    MarketDetailUpdateDTO queryGoodsIdAndNumAndMarketId(BigInteger marketDetailId);

    List<MarketDetailDTO> queryMarketDetailState(BigInteger marketUuid);

    int updateMarketState(@Param("marketUuid") BigInteger marketUuid,
                          @Param("ender") String ender,
                          @Param("end_time") LocalDateTime endTime);


    int insertStoreOper(StoreOper storeOper);

}
